<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>2.异步</title>
  </head>
  <body>
    <script type="text/javascript" >

      function test(){
        let str = ''
        setTimeout(() => {
          console.log('@')
          str = '你好'
        }, 1000);
        return str
      }

      let x = test()
      console.log(x)
    </script>
  </body>
</html>